package zfl.fanglong.cn.service;

import org.springframework.jms.core.JmsTemplate;

import zfl.fanglong.cn.domain.MyMessage;

public class JSMReciever {
	 private JmsTemplate jmsTemplate;
	  public void send(MyMessage mm){
		  jmsTemplate.convertAndSend(mm);
	  }
	  public MyMessage recieve(){
		  return (MyMessage) jmsTemplate.receiveAndConvert();
	  }
	  public MyMessage recieveFromConsole(){
		  return (MyMessage) jmsTemplate.receiveAndConvert("zfl.fanglong.cn.queue2");
	  }
	public JmsTemplate getJmsTemplate() {
		return jmsTemplate;
	}
	public void setJmsTemplate(JmsTemplate jmsTemplate) {
		this.jmsTemplate = jmsTemplate;
	}
	  
	}
